package org.example;
public class Cattle extends Animal{
    public Cattle() {
        super();
    }
    public Cattle(String name) {
        super(name);
    }

    @Override
    protected String getShoutSound() {
        return "哞";
    }
}
// 之前的写法
/*
// 牛
public class Cattle extends Animal{
    public Cattle() {
        super();
    }
    public Cattle(String name) {
        super(name);
    }

    public String shout() {
        String result = "";
        for(int i=0;i<this.shoutNum;i++){
            result +="哞 ";
        }
        return "我的名字叫" + name + " " + result;
    }
}
*/